<template>
    <rm-layout-left splitcolor="white" movingcolor="#00ff00" :splitwidth=0 :fixsize=0 :minfixsize=80 :canDrag=false>
        <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=65>
            <template v-slot:fix>
                <div style="height:100%;border:1px solid #CCC">
                    <div style="width:100%;float:left">
                        <table style="font-size:13px" class="table1style">
                            <tr>
                                <td>组合类别</td>
                                <td>
                                    <el-select v-model="txtgroupclass" filterable @change="initialListSearch">
                                        <el-option v-for="item in groupclassOptions" :key="item.value" :value="item.value" :label="item.label" filter></el-option>
                                    </el-select>
                                </td>
                                <td>快速查找</td>
                                <td>
                                    <el-input v-model="txtsearch" clearable placeholder="组合代码|名称|输入码" @keyup.enter.native="initialListSearch"></el-input>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div style="width:100%;float:left;">
                        <table style="float:right">
                            <tr>
                                <td>
                                    <el-button icon="el-icon-search" @click="refreshrecord()" v-has="'PINQUERY'" type="primary">查询</el-button>
                                </td>
                                <td>
                                    <el-button icon="el-icon-plus" @click="OpenDialog(1)" v-has="'PADD'">新增</el-button>
                                </td>
                                <td>
                                    <el-button icon="el-icon-edit" @click="OpenDialog(2)" v-has="'PMODIFY'" :disabled="havedata">修改</el-button>
                                </td>
                                <td>
                                    <el-button icon="el-icon-delete" @click="OpenDialog(3)" v-has="'PDELETE'" :disabled="havedata">删除</el-button>
                                </td>
                                <td>
                                    <el-button icon="el-icon-download" @click="ExportCsv()" v-has="'PEXPORT'">导出</el-button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </template>
            <rm-layout-right splitcolor="white" movingcolor="#0000ff" :splitwidth=5 :fixsize=450>
                <template v-slot:fix>
                    <rm-layout-top splitcolor="white" :splitwidth=5 :fixsize=260>
                        <template v-slot:fix>
                            <div style="height:100%;border:1px solid #CCC">
                                <el-form ref="combList" :model="combList">
                                    <table class="table2style" style="font-size:13px;center;width:100%">
                                        <tr>
                                            <td style="width:80px">组合代码：</td>
                                            <td>
                                                <el-input v-model="combList.combno" readonly style="width:100%"></el-input>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>组合名称：</td>
                                            <td>
                                                <el-input v-model="combList.combname" readonly></el-input>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>助记符：</td>
                                            <td>
                                                <el-input v-model="combList.inputcode" readonly></el-input>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="vertical-align:top">备注：</td>
                                            <td>
                                                <el-input type="textarea" :rows="4" v-model="combList.description" readonly></el-input>
                                            </td>
                                            <!-- <td>
                                        <div style="overflow:auto;border:1px solid #ccc">{{combList.description}}</div>
                                    </td> -->
                                        </tr>
                                    </table>
                                </el-form>
                            </div>
                        </template>

                        <div style="height:100%;width:100%;">
                            <vxe-table show-overflow ref="xTable2" height="auto" row-id="id" :loading="rloading" :select-config="{reserve: true}" :keyboard-config="keyConfig" class="compentstyle" :keyboard-local-config="keyLocalConfig" :data.sync="tableData2" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe>
                                <vxe-table-column type="index" title="NO." width="50" header-align="center" align="center"></vxe-table-column>
                                <vxe-table-column field="combno" title="组合代码" width="100" sortable header-align="center" align="center">
                                </vxe-table-column>
                                <vxe-table-column field="detailno" title="明细项目代码" width="100" header-align="center">
                                </vxe-table-column>
                                <vxe-table-column field="detailno" title="明细项目名称" width="120" header-align="center">
                                    <template v-slot="{row}">
                                        <rm-ddl-common @change="datachange($event,row)" datatype="dept" dataname="科室" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='DP'" :onlyshow="true" key="1"></rm-ddl-common>

                                        <rm-ddl-common @change="datachange($event,row)" datatype="ward" dataname="病区" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='WD'" :onlyshow="true" key="2"></rm-ddl-common>

                                        <rm-ddl-common @change="datachange($event,row)" datatype="specimen" dataname="标本类型" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='SP'" :onlyshow="true" key="3"></rm-ddl-common>

                                        <el-select v-model="row.detailno" v-if="txtgroupclass=='PT'" filter filterable clearable key="4" disabled>
                                            <el-option v-for="item in PTOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
                                        </el-select>

                                        <el-select v-model="row.detailno" v-if="txtgroupclass=='FT'" filter filterable clearable key="5" disabled>
                                            <el-option v-for="item in FTOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
                                        </el-select>

                                        <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="doctor" dataname="医生" width="100%" :appendtobody="true" v-if="txtgroupclass=='DC'" :onlyshow="true" key="6"></rm-ddl-common>

                                        <rm-ddl-common @change="datachange($event,row)" datatype="reqitem" dataname="申请项目" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='RQ'" :onlyshow="true" key="7"></rm-ddl-common>

                                        <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="userinfo" dataname="人员" width="100%" :appendtobody="true" v-if="txtgroupclass=='UR'" :onlyshow="true"  key="8"></rm-ddl-common>

                                        <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="reqgroup" dataname="分单类别" width="100%" :appendtobody="true" v-if="txtgroupclass=='GP'" :onlyshow="true"  key="9"></rm-ddl-common>
                                    </template>
                                </vxe-table-column>
                                <vxe-table-column field="seq" title="序号" width="60" header-align="center"></vxe-table-column>
                                <vxe-table-column field="seqweight" title="排序权重" width="100" header-align="center"></vxe-table-column>
                            </vxe-table>
                        </div>
                    </rm-layout-top>
                </template>
                <div style="height:100%;width:100%;background-color:#ddccbb;">
                    <vxe-table show-overflow ref="xTable1" height="auto" row-id="id" :loading="loading" :select-config="{reserve: true}" :keyboard-config="keyConfig" :edit-config="{showIcon: false,activeMethod:cellactiveMethod}" :keyboard-local-config="keyLocalConfig" :data.sync="tableData1" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe @current-change="currentChangeEvent">
                        <vxe-table-column type="index" title="NO." width="50" align="center"></vxe-table-column>
                        <vxe-table-column field="combkind" title="组合类别" width="90" sortable header-align="center" align="center"></vxe-table-column>
                        <vxe-table-column field="combno" title="组合代码" width="100" sortable header-align="center"></vxe-table-column>
                        <vxe-table-column field="combname" title="组合名称" width="100" header-align="center"></vxe-table-column>
                        <vxe-table-column field="inputcode" title="输入码" width="100" header-align="center"></vxe-table-column>
                        <vxe-table-column field="description" title="备注" width="180" header-align="center"></vxe-table-column>
                        <vxe-table-column field="hospcode" title="医院" width="200" sortable :edit-render="{name:'select',options: HospitalOptions}" header-align="center"></vxe-table-column>
                    </vxe-table>
                </div>
            </rm-layout-right>
        </rm-layout-top>
        <el-dialog :title="headtitle" :visible.sync="dialogVisible" :width="dialogwidth" v-el-drag-dialog :append-to-body="true" :close-on-click-modal="false">
            <div v-if="dialogshow">
                <div style="border:1px solid #CCC">
                    <el-form ref="popList" :model="popList">
                        <table style="text-align:right;font-size:12px;width:100%">
                            <tr>
                                <td style="width:100px">
                                    <font color="red">组合代码</font>
                                </td>
                                <td>
                                    <el-input v-model="popList.combno" ref="popinput0" @keyup.enter.native="inputautofocus($event,'popinput0')"></el-input>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <font color="red">组合名称</font>
                                </td>
                                <td>
                                    <el-input v-model.trim="popList.combname" type="text" ref="popinput1" @keyup.enter.native="inputautofocus($event,'popinput1')"></el-input>
                                </td>
                            </tr>
                            <tr>
                                <td>输入码</td>
                                <td>
                                    <el-input v-model="popList.inputcode" @keyup.enter.native="inputautofocus($event,'popinput2')" ref="popinput2"></el-input>
                                </td>
                            </tr>
                            <tr>
                                <td>备注说明</td>
                                <td>
                                    <el-input type="textarea" rows="2" v-model="popList.description" ref="popinput3" @keyup.enter.native="inputautofocus($event,'popinput3')" width="100%"></el-input>
                                </td>
                            </tr>
                        </table>
                    </el-form>
                </div>
                <div style="height:300px;margin-top:5px" class="popdialogstyle">
                    <vxe-table show-overflow border ref="xTable3" height="auto" size="mini" class="compentstyle" :loading="loading" :keyboard-config="keyConfig" :mouse-config="{selected: true}" :data.sync="tableData3" show-header-overflow highlight-current-row highlight-hover-row resizable stripe :edit-config="{trigger: 'click', mode: 'cell',showStatus: true}">
                        <vxe-table-column type="index" title="NO." width="50" header-align="center" align="center"></vxe-table-column>
                        <vxe-table-column field="combno" title="组合代码" width="100" sortable header-align="center" align="center"></vxe-table-column>
                        <vxe-table-column field="detailno" title="明细项目代码" width="160" header-align="center">
                            <template v-slot="{row}">
                                <rm-ddl-common @change="datachange($event,row)" datatype="dept" dataname="科室" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='DP'" :readonly="true"></rm-ddl-common>

                                <rm-ddl-common @change="datachange($event,row)" datatype="ward" dataname="病区" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='WD'" :readonly="true"></rm-ddl-common>

                                <rm-ddl-common @change="datachange($event,row)" datatype="specimen" dataname="标本类型" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='SP'" :readonly="true"></rm-ddl-common>

                                <el-select v-model="row.detailno" v-if="txtgroupclass=='PT'" filter filterable clearable>
                                    <el-option v-for="item in PTOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
                                </el-select>

                                <el-select v-model="row.detailno" v-if="txtgroupclass=='FT'" filter filterable clearable>
                                    <el-option v-for="item in FTOption" :key="item.value" :label="item.label" :value="item.value"></el-option>
                                </el-select>

                                <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="doctor" dataname="医生" width="100%" :appendtobody="true" v-if="txtgroupclass=='DC'" :readonly="true"></rm-ddl-common>

                                <rm-ddl-common @change="datachange($event,row)" datatype="reqitem" dataname="申请项目" v-model="row.detailno" width="100%" :appendtobody="true" v-if="txtgroupclass=='RQ'" :readonly="true"></rm-ddl-common>

                                <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="userinfo" dataname="人员" width="100%" :appendtobody="true" v-if="txtgroupclass=='UR'" :readonly="true"></rm-ddl-common>
                                <rm-ddl-common v-model="row.detailno" @change="datachange($event,row)" datatype="reqgroup" dataname="分单类别" width="100%" :appendtobody="true" v-if="txtgroupclass=='GP'" :readonly="true"></rm-ddl-common>
                            </template>
                        </vxe-table-column>
                        <vxe-table-column field="seq" title="序号" width="80" header-align="center" :edit-render="{name:'input', autoselect: true}" align="center"></vxe-table-column>
                        <vxe-table-column field="seqweight" title="排序权重" width="100" header-align="center" :edit-render="{name:'input', autoselect: true}"></vxe-table-column>
                    </vxe-table>
                </div>
            </div>
            <div v-else><span class="el-icon-info">确定删除组合名称为<b style="color:red">{{ message }}</b>的记录吗？</span></div>
            <span slot="footer" class="dialog-footer" v-if="dialogshow">
                <el-button @click.native="addRow()" class="mt-3" size="small" icon="el-icon-plus">新 增</el-button>
                <el-button @click.native="delRow()" class="mt-3" size="small" icon="el-icon-minus">删 除</el-button>
                <el-button @click.native="SubmitForm()" class="mt-3" size="small">确 定</el-button>
                <el-button @click="dialogVisible=false" :autofocus="true">取 消</el-button>
            </span>
            <span slot="footer" class="dialog-footer" v-else>
                <el-button @click.native="SubmitForm()" class="mt-3" size="small">确 定</el-button>
                <el-button @click="dialogVisible = false" :autofocus="true">取 消</el-button>
            </span>
        </el-dialog>
    </rm-layout-left>
</template>

<script type="text/javascript">
import XEUtils from "xe-utils";
export default {
    name: "MNG226",
    data() {
        return {
            loading: false,
            rloading: false,
            dialogshow: true,
            headtitle: "",
            dialogVisible: false,
            dialogdetailcount: 0,
            dialogwidth: "",
            popList: {},
            message: "",
            combno: "",
            txtsearch: "",
            hightrow: "0",
            txtgroupclass: "DP",
            combno: "",
            utype: this.$tool.getSession(this.$tool.loginutype),
            HospitalOptions: [],
            groupclassOptions: [
                { label: "科室", value: "DP" },
                { label: "病区", value: "WD" },
                { label: "病人类型", value: "PT" },
                { label: "标本类型", value: "SP" },
                { label: "医生", value: "DC" },
                { label: "费别", value: "FT" },
                { label: "申请项目", value: "RQ" },
                { label: "人员", value: "UR" },
                { label: "分单类别", value: "GP" },
            ],
            combList: {},
            tableData1: [],
            tableData2: [],
            tableData3: [],
            actionindex: 0,
            temptableData3: [],
            detailnoOption: [],
            FTOption: [],
            PTOption: [],
            oldformdata: {},
            okFirstLoading: true,
            keyConfig: {
                isDel: true,
                isTab: true,
                isEdit: true,
            },
            keyLocalConfig: {
                isArrow: true,
            },
            havedata: true,
        };
    },
    created() {
        this.ddlInitdata();
        this.initialListSearch(); //初始化主列表
        this.ddlInitialList(); //初始化病人类型
    },
    updated() {
        if (this.okFirstLoading) {
            this.comcallfun();
        }
        if (this.popList.combname != "") {
            let thisinputcode = "";
            let getpinyin = this.$pinyin(this.popList.combname, {
                style: this.$pinyin.STYLE_FIRST_LETTER, // 首字母
                heteronym: true,
            });
            for (var i = 0; i < getpinyin.length; i++) {
                var curchar = getpinyin[i];
                if (curchar.length > 1) {
                    thisinputcode += curchar[0];
                } else {
                    thisinputcode += curchar;
                }
            }
            this.$nextTick(() => {
                this.popList.inputcode = thisinputcode.toUpperCase();
            });
        }
    },
    methods: {
        ddlInitdata() {
            this.$tool
                .request({
                    url: "MNG/MNG2/MNG215",
                    method: "post",
                    data: {
                        action: "ddlInitialList",
                    },
                })
                .then((response) => {
                    this.HospitalOptions = response;
                });
        },
        refreshrecord() {
            this.initialListSearch();
        },
        comcallfun() {
            if (this.$refs.xTable1.tableData.length > 0) {
                let currentrow = "";
                if (this.actionindex != 0) {
                    //新增，修改，删除
                    if (this.actionindex == 3) {
                        //如果是删除
                        if (this.tempindex > 0) {
                            var alld = this.$refs.xTable1.tableData;
                            let havedata = this.$refs.xTable1.tableData;
                            if (havedata.length > 0) {
                                if (this.tempindex >= havedata.length) this.tempindex = havedata.length - 1;
                            }
                            currentrow = this.$refs.xTable1.getData(this.tempindex);
                        } else {
                            currentrow = this.$refs.xTable1.getData(0);
                        }
                    } else {
                        //新增或修改
                        if (this.hightrow && this.hightrow != "0") {
                            this.$nextTick(() => {
                                var alld = this.$refs.xTable1.tableData;
                                for (var i = 0; i < alld.length; i++) {
                                    if (alld[i].combno == this.hightrow) {
                                        this.tempindex = i;
                                        break;
                                    }
                                }
                                currentrow = this.$refs.xTable1.getData(this.tempindex);
                            });
                        } else {
                            currentrow = this.$refs.xTable1.getData(0);
                        }
                    }
                } else {
                    //查询
                    currentrow = this.$refs.xTable1.getData(0);
                    this.actionindex = 2;
                }
                this.$nextTick(() => {
                    if (currentrow) {
                        this.okFirstLoading = false;
                        this.$refs.xTable1.setCurrentRow(currentrow);
                        this.message = currentrow.combname;
                        this.$refs.xTable1.scrollToRow(currentrow);
                        this.funCurrentChangeEvent(currentrow);
                        this.ShowDetail();
                    }
                });
            } else {
                this.combList = {};
                this.tableData2 = [];
            }
        },
        addRow() {
            this.dialogdetailcount = 1;
            let oridata = this.$refs.xTable3.tableData;
            if (oridata.length > 0) {
                oridata.forEach((item) => {
                    if (this.dialogdetailcount <= Number(item.seq / 10)) {
                        this.dialogdetailcount = Number(item.seq / 10) + 1;
                    }
                });
            }
            let rowseq = this.dialogdetailcount * 10;
            this.$refs.xTable3.insert({
                combno: this.popList.combno,
                detailno: "",
                seq: rowseq,
                seqweight: 0,
            });
            let rows = this.$refs.xTable3.tableData;
            let selectrow = "";
            for (var i = 0; i < rows.length; i++) {
                if (rows[i].seq == rowseq) {
                    selectrow = rows[i];
                    break;
                }
            }
            if (selectrow && selectrow != "") {
                this.$refs.xTable3.setCurrentRow(selectrow);
                // this.$refs.xTable3.setActiveRow(selectrow, "combno");
            }
        },
        delRow() {
            var delrow = this.$refs.xTable3.getCurrentRow();
            if (delrow) {
                this.$refs.xTable3.remove(delrow);
                let havedata = this.$refs.xTable3.getTableData().fullData;
                if (havedata.length > 0) {
                    let selectrow = this.$refs.xTable3.getTableData().fullData[havedata.length - 1];
                    this.$refs.xTable3.setCurrentRow(selectrow);
                }
            } else {
                this.$message({
                    message: "请先选中要删除的项目",
                    type: "warning",
                });
            }
        },
        SubmitForm() {
            let tabledata = "";
            if (this.actionindex == 2 || this.actionindex == 1) {
                //修改或新增
                if (this.popList.combno == "") {
                    this.$message({
                        message: "请填写组合代码！",
                        type: "warning",
                    });
                    return false;
                } else if (this.popList.combname == "") {
                    this.$message({
                        message: "请填写组合名称！",
                        type: "warning",
                    });
                    return false;
                }
                let xTable3date = this.$refs.xTable3.tableData; //主表修改
                xTable3date.sort((a, b) => {
                    return a.seq - b.seq;
                });
                for (let i = 0, len = xTable3date.length; i < len; i++) {
                    xTable3date[i].seq = (i + 1) * 10;
                }
                tabledata = this.$refs.xTable3.getRecordset();

                let insertresult = [];
                let insertobj = tabledata.insertRecords;
                for (var i = 0; i < insertobj.length; i++) {
                    var obj = insertobj[i];
                    if (!!obj["detailno"]) {
                        insertresult.push(obj);
                    }
                }
                tabledata.insertRecords = insertresult;
                let updateobj = tabledata.updateRecords;
                for (var i = 0; i < updateobj.length; i++) {
                    var obj = updateobj[i].cdata;
                    if (!obj["detailno"]) {
                        this.$message({
                            message: "请勿将数据更新为空值(序号：" + obj["seq"] + ")，如不需要，请删除！",
                            type: "warning",
                        });
                        return false;
                    }
                }
            }

            let formdata = {
                combkind: this.txtgroupclass,
                combno: this.popList.combno,
                combname: this.popList.combname,
                inputcode: this.popList.inputcode,
                description: this.popList.description,
                hospcode: this.popList.hospcode,
            };
            this.$tool
                .request({
                    url: "MNG/MNG2/MNG226",
                    method: "post",
                    data: {
                        action: "save",
                        utype: this.actionindex,
                        saveinfo: formdata,
                        oldinfo: this.oldformdata,
                        urec: tabledata,
                    },
                })
                .then((response) => {
                    if (response.errcode == "1") {
                        this.$message({
                            message: "操作成功！",
                            type: "success",
                        });
                        this.dialogVisible = false;
                        if (this.actionindex != 3) {
                            //新增时记录新增数据的主键
                            this.hightrow = response.keyid;
                        } else {
                            this.hightrow = "0";
                        }
                        this.initialListSearch();
                    } else {
                        this.$message({
                            message: "保存失败！" + response.errmsg,
                            type: "warning",
                        });
                    }
                });
        },
        currentChangeEvent({ row, rowIndex }) {
            this.tempindex = rowIndex;
            this.hightrow = row.combno;
            this.funCurrentChangeEvent(row);
        },
        funCurrentChangeEvent(row) {
            this.combno = row.combno;
            this.combList = {
                combkind: row.combkind,
                combno: row.combno,
                combname: row.combname,
                inputcode: row.inputcode,
                description: row.description,
                hospcode: row.hospcode,
            };
            this.oldformdata = XEUtils.clone(this.combList, true);
            this.popList = XEUtils.clone(this.oldformdata, true);
            this.ShowDetail();
        },
        ddlInitialList() {
            this.$tool
                .request({
                    url: "MNG/MNG2/MNG226",
                    method: "post",
                    data: {
                        action: "ddlInitialList",
                    },
                })
                .then((response) => {
                    this.PTOption = response.dt;
                    this.FTOption = response.dt2;
                })
                .catch((e) => {
                    console.log("error", e);
                });
        },
        initialListSearch() {
            this.loading = true;
            this.$tool
                .request({
                    url: "MNG/MNG2/MNG226",
                    method: "post",
                    data: {
                        action: "query",
                        combkind: this.txtgroupclass,
                        txtsearch: this.txtsearch,
                    },
                })
                .then((response) => {
                    this.tableData1 = response.Data;
                    if (response.Data.length > 0) {
                        this.havedata = false;
                        this.funCurrentChangeEvent(response.Data[0]);
                    } else {
                        this.popList = {};
                        this.tableData2 = [];
                        this.tableData3 = [];
                        this.havedata = true;
                    }
                    this.loading = false;
                    this.okFirstLoading = true;
                })
                .catch((e) => {
                    this.loading = false;
                });
        },
        ShowDetail() {
            this.rloading = true;
            this.$tool
                .request({
                    url: "MNG/MNG2/MNG226",
                    method: "post",
                    data: {
                        action: "getDataDetail",
                        combkind: this.txtgroupclass,
                        combno: this.combno,
                    },
                })
                .then((response) => {
                    this.tableData2 = response.Data;
                    this.temptableData3 = XEUtils.clone(this.tableData2, true);
                    this.rloading = false;
                })
                .catch((e) => {
                    this.rloading = false;
                });
        },
        inputautofocus(event, element) {
            if (element == "popinput0") {
                this.$refs.popinput1.focus();
            }
            if (element == "popinput1") {
                this.$refs.popinput2.focus();
            }
            if (element == "popinput2") {
                this.$refs.popinput3.focus();
                this.$refs.popinput2.blur();
            }
            if (element == "popinput3") {
                this.$refs.popinput4.focus();
            }
        },
        OpenDialog(k) {
            this.actionindex = k;
            if (k == 1) {
                //新增
                this.dialogshow = true;
                this.headtitle = "新增报告单元组合";
                this.dialogwidth = "45%";
                this.dialogVisible = true;
                this.popList = {
                    //点击列赋值
                    combkind: this.txtgroupclass,
                    combno: "",
                    combname: "",
                    description: "",
                    inputcode: "",
                    hospcode: this.$tool.getSession(this.$tool.selectedhis),
                };
                this.$nextTick(() => {
                    this.$refs.popinput0.focus();
                });
                this.tableData3 = [];
            } else if (k == 2) {
                //修改
                if (this.utype != "G" && this.popList.hospcode == "All") {
                    this.$alert("您不是管理员，不能修改医院代码为All的数据！", "提示", {
                        confirmButtonText: "确定",
                    });
                    return false;
                } else {
                    this.dialogshow = true;
                    this.headtitle = "修改报告单元组合";
                    this.dialogwidth = "45%";
                    this.dialogVisible = true;
                    this.popList = XEUtils.clone(this.oldformdata, true);
                    this.tableData3 = XEUtils.clone(this.temptableData3, true);
                    this.$nextTick(() => {
                        this.$refs.popinput0.focus();
                    });
                }
            } else {
                //删除
                if (this.utype != "G" && this.popList.hospcode == "All") {
                    this.$alert("您不是管理员，不能删除医院代码为All的数据！", "提示", {
                        confirmButtonText: "确定",
                    });
                    return false;
                } else {
                    this.dialogshow = false;
                    this.headtitle = "提示";
                    this.dialogwidth = "30%";
                    this.dialogVisible = true;
                }
            }
        },
        datachange($event, row) {
            row.detailno = $event;
        },
        ExportCsv() {
            let options = {
                filename: "MNG226 常见字典组合",
            };
            this.$refs.xTable1.exportCsv(options);
        },
        cellactiveMethod({ row, column }) {
            return false;
        },
    },
};
</Script>

<style scoped>
.table1style tr td {
    padding: 0px 2px 0px 5px;
}
.table2style tr td {
    padding: 2px 2px 3px 0px;
}
.table2style tr td:nth-child(1) {
    text-align: right;
}
/deep/.compentstyle tr td div .el-input__inner {
    border: 1px solid rgba(255, 254, 254, 0) !important;
    background-color: rgba(255, 254, 254, 0) !important;
}
/deep/.el-input.is-disabled .el-input__inner {
    color: #000000;
    border: 0px;
    cursor: default;
}
/deep/ .el-textarea.is-disabled .el-textarea__inner {
    color: #000000;
    border: 0px;
    cursor: default;
}
</style>